1. Field of the Invention
The present invention relates to the field of computer graphics and, in particular, to techniques for lighting characters in a computer-generated graphics scene.
2. Description of the Related Art
It is common for video games to pre-compute the static or diffuse lighting for three-dimensional (3D) scene geometry. The pre-computed lighting data is then used to light elements of the scene geometry at runtime (i.e., when the video game is played). This approach separates the lighting used for static elements of the scene from the lighting of dynamic elements, such as characters.
Generating realistic character lighting in video games using precomputed lighting is a challenging problem. As the use of static precomputed lighting in games has become more common, it has become important to ensure that the characters are lit in a way that visually places them in the lighting environment of the scene. Precomputed lighting in a 3D scene is frequently based on hundreds of light sources placed by a lighting artist. However, evaluating large numbers of light sources analytically to light a character at runtime is impractical on current console hardware, so the lights are typically projected into a spherical harmonic (SH) basis centered at the character every frame, decoupling lighting complexity when rendering a character. For example, one technique for lighting characters in a scene with precomputed lighting is to generate lighting textures using a virtual point light model (placed by a lighting artist) and using these sources to light the character at runtime, e.g., using an instant radiosity technique.
However, this approach to lighting a character does not produce realistic images in a certain common situations. For example, light sources near a character, (e.g., a flare) look wrong. The higher the intensity of the near light source, the less realistic the appearance of the character lighting that results, as the lighting does not change over the surface of the character. Similarly, lighting large objects (e.g., a dinosaur) can have significant lighting variation over the object, even for mid-distant lighting. The worst-case scenario is when both problems are present, e.g., a flare near the tail of a dinosaur.